---
lang: de
execute:
echo: false
bibliography: references.bib
csl: apa.csl
---
```{r, eval = T, cache = F}
rbbt::bbt_update_bib("syllabus.qmd")
```
# Syllabus {.unnumbered}
```{r}
pacman::p_load(dplyr,
lubridate,
googlesheets4,
gt,
timesaveR)
```
```{r}
# tell googlesheets4 we don't want private
gs4_deauth()
```
```{r}
#| eval: true
# Create syllabus structure ####
# define negative %in%; don't end up using this I think
'%ni%' <- Negate("%in%")
# create tibble containing all weekly dates from first lecture until last
dates <- tibble(
Datum = as.character(seq(ymd("2023-10-18"), ymd("2024-2-14"), by = "weeks")))
# create vector with dates of holidays
holidays <- c("2024-01-03",
"2023-12-27" )
# remove holiday dates and add Woche, which lists the week number
syllabus <-
dates |>
mutate(class = ifelse(Datum %in% holidays, "Vorlesungsfrei", "class")) |>
mutate(Woche = 1:length(Datum), .by = class, .before = Datum) |>
mutate(Woche = ifelse(Datum %in% holidays, "Vorlesungsfrei", Woche)) |>
select(-class)
```
```{r}
# inspiration: https://github.com/vizdata-s23/vizdata-s23/blob/main/index.qmd
content <-
googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1zg0Rb5S8p4oggjWxMU60zC8aFTJIblx3pAuI0SON4AY/edit?usp=sharing") |>
mutate(Woche = as.character(Woche),
Thema = ifelse(is.na(topic_link), topic,
paste0(
"[",topic,"]",
"(","https://daniela-palleschi.github.io/ba-datenverarbeitung-wise23/",topic_link,")")),
Vorbereitung = ifelse(is.na(prepare_link), prepare,
paste0("[",prepare,"]","(",prepare_link,")"))) |>
select(Woche, Thema, Vorbereitung)
```
```{r}
left_join(
syllabus, content, by = "Woche"
) |>
gt() |>
sub_missing(columns = c(Woche, Thema, Vorbereitung), missing_text = "") |>
cols_align(
align = "center",
columns = c(Woche)
) |>
cols_align(
align = "left",
columns = c(Thema, Vorbereitung)
) |>
tab_style(
style = cell_borders(
sides = "right",
color = "#D3D3D3",
style = "solid"
),
locations = cells_body(
columns = c(Thema, Vorbereitung)
)
) |>
fmt_markdown(
columns = c(Thema, Vorbereitung)
) |>
cols_width(
Woche ~ px(150),
Thema ~ px(400),
Vorbereitung ~ px(300)
)
```